package agh.sr.lab4.bank.server;

import java.io.IOException;

import Bank._BankManagerDisp;
import Ice.Current;
import agh.sr.lab4.common.utils.BankAccountDataFileProvider;
import agh.sr.lab4.common.utils.IBankAccountDataProvider;

public class BankManagerI extends _BankManagerDisp {
	private static final long serialVersionUID = 5649035768709267815L;
	IBankAccountDataProvider accountDataProvider = new BankAccountDataFileProvider();

	@Override
	public synchronized void createAccount(String pesel, Current __current) {
		System.out.println("=== BankManagerI.createAccount(" + pesel + ")===");

		try {
			accountDataProvider.createAccount(pesel);
		} catch (IOException e) {
			System.err.println("Error when creating new file");
			e.printStackTrace();
		}
	}

}
